3.1.18 \(\int \frac {\sin ^4(x)}{a+b \cos ^2(x)} \, dx\) [18]

Optimal. Leaf size=60 \[ -\frac {(2 a+3 b) x}{2 b^2}-\frac {(a+b)^{3/2} \text {ArcTan}\left (\frac {\sqrt {a+b} \cot (x)}{\sqrt {a}}\right )}{\sqrt {a} b^2}+\frac {\cos (x) \sin (x)}{2 b} \]

[Out]

-1/2*(2*a+3*b)*x/b^2+1/2*cos(x)*sin(x)/b-(a+b)^(3/2)*arctan(cot(x)*(a+b)^(1/2)/a^(1/2))/b^2/a^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.07, antiderivative size = 60, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3270, 425, 536, 209, 211} \begin {gather*} -\frac {(a+b)^{3/2} \text {ArcTan}\left (\frac {\sqrt {a+b} \cot (x)}{\sqrt {a}}\right )}{\sqrt {a} b^2}-\frac {x (2 a+3 b)}{2 b^2}+\frac {\sin (x) \cos (x)}{2 b} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sin[x]^4/(a + b*Cos[x]^2),x]

[Out]

-1/2*((2*a + 3*b)*x)/b^2 - ((a + b)^(3/2)*ArcTan[(Sqrt[a + b]*Cot[x])/Sqrt[a]])/(Sqrt[a]*b^2) + (Cos[x]*Sin[x]
)/(2*b)

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 211

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 425

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[(-b)*x*(a + b*x^n)^(p + 1)*
((c + d*x^n)^(q + 1)/(a*n*(p + 1)*(b*c - a*d))), x] + Dist[1/(a*n*(p + 1)*(b*c - a*d)), Int[(a + b*x^n)^(p + 1
)*(c + d*x^n)^q*Simp[b*c + n*(p + 1)*(b*c - a*d) + d*b*(n*(p + q + 2) + 1)*x^n, x], x], x] /; FreeQ[{a, b, c,
d, n, q}, x] && NeQ[b*c - a*d, 0] && LtQ[p, -1] &&  !( !IntegerQ[p] && IntegerQ[q] && LtQ[q, -1]) && IntBinomi
alQ[a, b, c, d, n, p, q, x]

Rule 536

Int[((e_) + (f_.)*(x_)^(n_))/(((a_) + (b_.)*(x_)^(n_))*((c_) + (d_.)*(x_)^(n_))), x_Symbol] :> Dist[(b*e - a*f
)/(b*c - a*d), Int[1/(a + b*x^n), x], x] - Dist[(d*e - c*f)/(b*c - a*d), Int[1/(c + d*x^n), x], x] /; FreeQ[{a
, b, c, d, e, f, n}, x]

Rule 3270

Int[cos[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = FreeF
actors[Tan[e + f*x], x]}, Dist[ff/f, Subst[Int[(a + (a + b)*ff^2*x^2)^p/(1 + ff^2*x^2)^(m/2 + p + 1), x], x, T
an[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[m/2] && IntegerQ[p]

Rubi steps

\begin {align*} \int \frac {\sin ^4(x)}{a+b \cos ^2(x)} \, dx &=-\text {Subst}\left (\int \frac {1}{\left (1+x^2\right )^2 \left (a+(a+b) x^2\right )} \, dx,x,\cot (x)\right )\\ &=\frac {\cos (x) \sin (x)}{2 b}-\frac {\text {Subst}\left (\int \frac {a+2 b+(-a-b) x^2}{\left (1+x^2\right ) \left (a+(a+b) x^2\right )} \, dx,x,\cot (x)\right )}{2 b}\\ &=\frac {\cos (x) \sin (x)}{2 b}-\frac {(a+b)^2 \text {Subst}\left (\int \frac {1}{a+(a+b) x^2} \, dx,x,\cot (x)\right )}{b^2}+\frac {(2 a+3 b) \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\cot (x)\right )}{2 b^2}\\ &=-\frac {(2 a+3 b) x}{2 b^2}-\frac {(a+b)^{3/2} \tan ^{-1}\left (\frac {\sqrt {a+b} \cot (x)}{\sqrt {a}}\right )}{\sqrt {a} b^2}+\frac {\cos (x) \sin (x)}{2 b}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.11, size = 52, normalized size = 0.87 \begin {gather*} \frac {-4 a x-6 b x+\frac {4 (a+b)^{3/2} \text {ArcTan}\left (\frac {\sqrt {a} \tan (x)}{\sqrt {a+b}}\right )}{\sqrt {a}}+b \sin (2 x)}{4 b^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sin[x]^4/(a + b*Cos[x]^2),x]

[Out]

(-4*a*x - 6*b*x + (4*(a + b)^(3/2)*ArcTan[(Sqrt[a]*Tan[x])/Sqrt[a + b]])/Sqrt[a] + b*Sin[2*x])/(4*b^2)

________________________________________________________________________________________

Maple [A]
time = 0.14, size = 61, normalized size = 1.02

method result size
default \(-\frac {-\frac {b \tan \left (x \right )}{2 \left (1+\tan ^{2}\left (x \right )\right )}+\frac {\left (2 a +3 b \right ) \arctan \left (\tan \left (x \right )\right )}{2}}{b^{2}}+\frac {\left (a +b \right )^{2} \arctan \left (\frac {a \tan \left (x \right )}{\sqrt {\left (a +b \right ) a}}\right )}{b^{2} \sqrt {\left (a +b \right ) a}}\) \(61\)
risch \(-\frac {a x}{b^{2}}-\frac {3 x}{2 b}-\frac {i {\mathrm e}^{2 i x}}{8 b}+\frac {i {\mathrm e}^{-2 i x}}{8 b}+\frac {\sqrt {-\left (a +b \right ) a}\, \ln \left ({\mathrm e}^{2 i x}-\frac {2 i \sqrt {-\left (a +b \right ) a}-2 a -b}{b}\right )}{2 b^{2}}+\frac {\sqrt {-\left (a +b \right ) a}\, \ln \left ({\mathrm e}^{2 i x}-\frac {2 i \sqrt {-\left (a +b \right ) a}-2 a -b}{b}\right )}{2 a b}-\frac {\sqrt {-\left (a +b \right ) a}\, \ln \left ({\mathrm e}^{2 i x}+\frac {2 i \sqrt {-\left (a +b \right ) a}+2 a +b}{b}\right )}{2 b^{2}}-\frac {\sqrt {-\left (a +b \right ) a}\, \ln \left ({\mathrm e}^{2 i x}+\frac {2 i \sqrt {-\left (a +b \right ) a}+2 a +b}{b}\right )}{2 a b}\) \(209\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(x)^4/(a+b*cos(x)^2),x,method=_RETURNVERBOSE)

[Out]

-1/b^2*(-1/2*b*tan(x)/(tan(x)^2+1)+1/2*(2*a+3*b)*arctan(tan(x)))+(a+b)^2/b^2/((a+b)*a)^(1/2)*arctan(a*tan(x)/(
(a+b)*a)^(1/2))

________________________________________________________________________________________

Maxima [A]
time = 0.48, size = 62, normalized size = 1.03 \begin {gather*} -\frac {{\left (2 \, a + 3 \, b\right )} x}{2 \, b^{2}} + \frac {\tan \left (x\right )}{2 \, {\left (b \tan \left (x\right )^{2} + b\right )}} + \frac {{\left (a^{2} + 2 \, a b + b^{2}\right )} \arctan \left (\frac {a \tan \left (x\right )}{\sqrt {{\left (a + b\right )} a}}\right )}{\sqrt {{\left (a + b\right )} a} b^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)^4/(a+b*cos(x)^2),x, algorithm="maxima")

[Out]

-1/2*(2*a + 3*b)*x/b^2 + 1/2*tan(x)/(b*tan(x)^2 + b) + (a^2 + 2*a*b + b^2)*arctan(a*tan(x)/sqrt((a + b)*a))/(s
qrt((a + b)*a)*b^2)

________________________________________________________________________________________

Fricas [A]
time = 0.45, size = 211, normalized size = 3.52 \begin {gather*} \left [\frac {2 \, b \cos \left (x\right ) \sin \left (x\right ) + {\left (a + b\right )} \sqrt {-\frac {a + b}{a}} \log \left (\frac {{\left (8 \, a^{2} + 8 \, a b + b^{2}\right )} \cos \left (x\right )^{4} - 2 \, {\left (4 \, a^{2} + 3 \, a b\right )} \cos \left (x\right )^{2} - 4 \, {\left ({\left (2 \, a^{2} + a b\right )} \cos \left (x\right )^{3} - a^{2} \cos \left (x\right )\right )} \sqrt {-\frac {a + b}{a}} \sin \left (x\right ) + a^{2}}{b^{2} \cos \left (x\right )^{4} + 2 \, a b \cos \left (x\right )^{2} + a^{2}}\right ) - 2 \, {\left (2 \, a + 3 \, b\right )} x}{4 \, b^{2}}, \frac {b \cos \left (x\right ) \sin \left (x\right ) - {\left (a + b\right )} \sqrt {\frac {a + b}{a}} \arctan \left (\frac {{\left ({\left (2 \, a + b\right )} \cos \left (x\right )^{2} - a\right )} \sqrt {\frac {a + b}{a}}}{2 \, {\left (a + b\right )} \cos \left (x\right ) \sin \left (x\right )}\right ) - {\left (2 \, a + 3 \, b\right )} x}{2 \, b^{2}}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)^4/(a+b*cos(x)^2),x, algorithm="fricas")

[Out]

[1/4*(2*b*cos(x)*sin(x) + (a + b)*sqrt(-(a + b)/a)*log(((8*a^2 + 8*a*b + b^2)*cos(x)^4 - 2*(4*a^2 + 3*a*b)*cos
(x)^2 - 4*((2*a^2 + a*b)*cos(x)^3 - a^2*cos(x))*sqrt(-(a + b)/a)*sin(x) + a^2)/(b^2*cos(x)^4 + 2*a*b*cos(x)^2
+ a^2)) - 2*(2*a + 3*b)*x)/b^2, 1/2*(b*cos(x)*sin(x) - (a + b)*sqrt((a + b)/a)*arctan(1/2*((2*a + b)*cos(x)^2
- a)*sqrt((a + b)/a)/((a + b)*cos(x)*sin(x))) - (2*a + 3*b)*x)/b^2]

________________________________________________________________________________________

Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)**4/(a+b*cos(x)**2),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]
time = 0.42, size = 80, normalized size = 1.33 \begin {gather*} -\frac {{\left (2 \, a + 3 \, b\right )} x}{2 \, b^{2}} + \frac {{\left (\pi \left \lfloor \frac {x}{\pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (a\right ) + \arctan \left (\frac {a \tan \left (x\right )}{\sqrt {a^{2} + a b}}\right )\right )} {\left (a^{2} + 2 \, a b + b^{2}\right )}}{\sqrt {a^{2} + a b} b^{2}} + \frac {\tan \left (x\right )}{2 \, {\left (\tan \left (x\right )^{2} + 1\right )} b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)^4/(a+b*cos(x)^2),x, algorithm="giac")

[Out]

-1/2*(2*a + 3*b)*x/b^2 + (pi*floor(x/pi + 1/2)*sgn(a) + arctan(a*tan(x)/sqrt(a^2 + a*b)))*(a^2 + 2*a*b + b^2)/
(sqrt(a^2 + a*b)*b^2) + 1/2*tan(x)/((tan(x)^2 + 1)*b)

________________________________________________________________________________________

Mupad [B]
time = 2.45, size = 126, normalized size = 2.10 \begin {gather*} \frac {\cos \left (x\right )\,\sin \left (x\right )}{2\,b}-\frac {a\,\mathrm {atan}\left (\frac {\sin \left (x\right )}{\cos \left (x\right )}\right )}{b^2}-\frac {3\,\mathrm {atan}\left (\frac {\sin \left (x\right )}{\cos \left (x\right )}\right )}{2\,b}-\frac {\mathrm {atanh}\left (\frac {\sin \left (x\right )\,\sqrt {-a^4-3\,a^3\,b-3\,a^2\,b^2-a\,b^3}}{\cos \left (x\right )\,a^2+2\,\cos \left (x\right )\,a\,b+\cos \left (x\right )\,b^2}\right )\,\sqrt {-a^4-3\,a^3\,b-3\,a^2\,b^2-a\,b^3}}{a\,b^2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(x)^4/(a + b*cos(x)^2),x)

[Out]

(cos(x)*sin(x))/(2*b) - (a*atan(sin(x)/cos(x)))/b^2 - (3*atan(sin(x)/cos(x)))/(2*b) - (atanh((sin(x)*(- a*b^3
- 3*a^3*b - a^4 - 3*a^2*b^2)^(1/2))/(a^2*cos(x) + b^2*cos(x) + 2*a*b*cos(x)))*(- a*b^3 - 3*a^3*b - a^4 - 3*a^2
*b^2)^(1/2))/(a*b^2)

________________________________________________________________________________________